package org.xi.behavioral.strategy;

import org.xi.behavioral.strategy.context.Traveler;
import org.xi.behavioral.strategy.travel.AirplaneStrategy;
import org.xi.behavioral.strategy.travel.TrainStrategy;

public class Main {
    public static void main(String[] args) {
        Traveler traveler = new Traveler();

        System.out.println("选择飞机出行：");
        traveler.setTravelStrategy(new AirplaneStrategy());
        traveler.startJourney();

        System.out.println("\n选择火车出行：");
        traveler.setTravelStrategy(new TrainStrategy());
        traveler.startJourney();
    }
}